<%@ page pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/style.css"/>
    <title>商品管理</title>
    <style type="text/css">
        th {
            text-align: center;
        }
    </style>
</head>
<body>

<div class="container">
    <div class="row">
        <nav class="navbar navbar-default">
            <div class="container-fluid">
                <!-- Brand and toggle get grouped for better mobile display -->
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>

                    <a class="navbar-brand" href="#" style="font-size: 28px;">商品管理</a>
                </div>
                <!-- Collect the nav links, forms, and other content for toggling -->
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav">
                        <li><a href="${pageContext.request.contextPath}/category/selectCategoryByPage">类别管理</a></li>
                        <li><a href="${pageContext.request.contextPath}/product/selectProducts">商品管理</a></li>
                    </ul>
                    <ul class="nav navbar-nav navbar-right">
                        <li><a href="${pageContext.request.contextPath}/exit">退出系统 <span class="czs-out-l"></span></a></li>
                    </ul>
                </div><!-- /.navbar-collapse -->
            </div><!-- /.container-fluid -->
        </nav>
    </div>
    <div class="row">
        <div class="col-md-3">
            <a href="${pageContext.request.contextPath}/category/AddCategory.jsp" class="btn btn-success">添加类别</a>
        </div>
        <div class="col-md-6">
        </div>
        <div class="col-md-3">
            <p class="bg-warning" style="">
                欢迎:[再见孙悟空] &nbsp;&nbsp;&nbsp; <img src="${pageContext.request.contextPath}/img/girl.jpg" width="50px" class="img-rounded" alt="" />
            </p>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12" style="height: 10px;"></div>
    </div>
    <div class="row">
        <div class="col-md-12" style="text-align: center;">
            <form action="#">
                <table class="table table-bordered table-hover">
                    <thead>
                    <tr class="btn-primary">
                        <th>类别编号</th>
                        <th>类别名称</th>
                        <th>介绍</th>
                        <th>商品数量</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="c" items="${categorys}">
                        <tr>
                            <td>${c.id}</td>
                            <td>${c.name}</td>
                            <td>${c.desc}</td>
                            <td>
                                <span class="label label-primary">${c.num}</span>
                            </td>
                            <td>
                                <a href="${pageContext.request.contextPath}/category/getOneCatgory?c.id=${c.id}" class="btn btn-xs btn-info">修改<span class="czs-web-edit"></span></a>
                            </td>
                        </tr>
                    </c:forEach>

                    </tbody>
                </table>
            </form>
        </div>
    </div>
    <div class="row">
        <div class="col-md-4"></div>
        <div class="col-md-4">
            <c:if test="${pageNum>1}">
                <a href="${pageContext.request.contextPath}/category/selectCategoryByPage?pageNum=${pageNum-1}" class="btn btn-default">上一页 </a>
            </c:if>
            <a href="#" class="disabled btn btn-default">当前${pageNum}页,共${totalPage}页</a>
            <c:if test="${pageNum<totalPage}">
                <a href="${pageContext.request.contextPath}/category/selectCategoryByPage?pageNum=${pageNum+1}" class="btn btn-default">下一页</a>
            </c:if>
        </div>
        <div class="col-md-4"></div>
    </div>
</div>

</body>
</html>
